<!--
	This file is part of ELCube.
	ELCube is free software: you can redistribute it and/or modify
	it under the terms of the GNU Affero General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.
	ELCube is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Affero General Public License for more details.
	You should have received a copy of the GNU Affero General Public License
	along with ELCube.  If not, see <https://www.gnu.org/licenses/>.
-->
<template>
    <nk-card>
        <a-switch v-if="data.xml" slot="extra" size="small" v-model="showXml"></a-switch>
        <a-button @click="nk$calc" slot="extra" size="small" v-if="editMode">测试运行</a-button>

        <codemirror  v-if="data.xml && showXml"
                    :options="codeMirrorOptions"
                    :value="data.xml"
        ></codemirror>

        <div v-else-if="data.xml">
            <nk-form :col="3">
                <nk-form-item title="凭证类别">
                    {{data.pk_vouchertype}}
                </nk-form-item>
                <nk-form-item title="凭证类型值">
                    {{data.voucherkind}}
                </nk-form-item>
                <nk-form-item title="来源系统">
                    {{data.pk_system}}
                </nk-form-item>
                <nk-form-item title="所属集团">
                    {{data.pk_group}}
                </nk-form-item>
                <nk-form-item title="所属组织">
                    {{data.pk_org}}
                </nk-form-item>
                <nk-form-item title="所属组织版本">
                    {{data.pk_org_v}}
                </nk-form-item>
                <nk-form-item title="核算账簿">
                    {{data.pk_accountingbook}}
                </nk-form-item>

                <nk-form-item title="会计年度">
                    {{data.year}}
                </nk-form-item>
                <nk-form-item title="会计期间">
                    {{data.period}}
                </nk-form-item>
                <nk-form-item title="附单据数">
                    {{data.attachment}}
                </nk-form-item>
                <nk-form-item title="凭证号" :col="2">
                    {{data.no}}
                </nk-form-item>
                <nk-form-item title="制单人">
                    {{data.pk_prepared}}
                </nk-form-item>
                <nk-form-item title="签字标志">
                    {{data.signflag}}
                </nk-form-item>
            </nk-form>
        </div>
    </nk-card>
</template>

<script>
    import Mixin from "Mixin";

    export default {
        mixins:[new Mixin({})],
        data(){
            return {
                showXml:false,

                codeMirrorOptions:{
                    mode:"xml",
                    theme: "ambiance",
                    lineWrapping:false,
                    indentUnit:4,
                    tabSize: 4,
                    lineNumbers: true,
                    readOnly:true,
                }
            }
        }
    }
</script>

<style scoped>

</style>